﻿@using Webdiyer.WebControls.Mvc;
@using MinistryStandardPlatformWeb;
@using MinistryStandardPlatformWeb.Models;
@model PagedList<MinistryStandardPlatformWeb.Models.WarningStatistics>

<style>
    a
    {
        color: #428bca;
        text-decoration: none;
        cursor: pointer;
    }

    a:hover, a:focus
    {
        color: #2a6496;
        text-decoration: underline;
    }

    select
    {
        height: auto;
    }

    th
    {
        word-break: keep-all;
        white-space: nowrap;
    }

    td
    {
        word-break: keep-all;
        white-space: nowrap;
    }

    td, tr, th
    {
        height: 22px !important;
    }
</style>
<input type="hidden" id="vehicleName" value="@ViewBag.VehicleName" />
<input type="hidden" id="mileageData" value="@ViewBag.MileageData" />
<input type="hidden" id="oilData" value="@ViewBag.OilData" />
<input type="hidden" id="speedData" value="@ViewBag.SpeedData" />
<input type="hidden" id="timeData" value="@ViewBag.TimeData" />
<div id="chartContainer" class="fillparentheight" style="border: #95B8E7 1px solid;">
</div>
<div style="height: 25px; line-height: 25px; text-align: center; vertical-align: middle;">
    <div style="margin: auto; background: #E0ECFF;">
        统计时长：@(ViewBag.StatisticsTime)   行驶里程：@(ViewBag.MoveDistance)km    加油：@(ViewBag.TotalAddedOil)L    耗油：@(ViewBag.UsedOil)L    平均油耗：@(ViewBag.OilPer100Km)L/100km
    </div>
</div>
<div style="height: 250px;" class="box verticalbox easyui-tabs" id="tabscontainer">
    <div class="fillparentheight box verticalbox" title="时间油量" data-options="closable:false">
        <div class="fillparentheight" style="overflow: auto;" id="oilanalysiscontainer">
            <table class="tablelist" id="oilanalysis">
                <thead>
                    <tr>
                        <th>序号</th>
                        <th>时间</th>
                        <th>油量(L)</th>
                        <th>总里程(km)</th>
@*                        <th>相对前次行驶(km)</th>*@
                        <th>速度(km/h)</th>
                    </tr>
                </thead>
                <tbody>
                    @{
                        int i = 1;
                        foreach (OilAnalysis item in @ViewBag.TimeOil as List<OilAnalysis>)
                        {
                        <tr id="oilanalysis@(item.Time.Replace(" ", ""))">
                            <td>@i</td>
                            <td>@item.Time</td>
                            <td>@item.Oil</td>
                            <td>@item.Mileage</td>
                            @*<td>@{
                            if (item.MoveDistance != null)
                            {
                                @item.MoveDistance.Value.ToString("f3");
                            }
                            }</td>*@
                            <td>@item.Speed</td>
                        </tr>
                            i++;
                        }
                    }
                </tbody>
            </table>
        </div>
        <div style="margin-top: 5px;">
            <div style="float: right; margin-right: 18px;">
                <input type="button" value="导出结果" onclick="tableToExcel('时间油量明细', 'oilanalysis');" />
            </div>
        </div>
    </div>
    <div class="fillparentheight box verticalbox" title="加油" data-options="closable:false">
        <div class="fillparentheight" style="overflow: auto;">
            <table class="tablelist" id="addoil">
                <thead>
                    <tr>
                        <th>序号</th>
                        <th>开始时间</th>
                        <th>结束时间</th>
                        <th>加油前(L)</th>
                        <th>加油后(L)</th>
                        <th>加油(L)</th>
                        <th>位置</th>
                    </tr>
                </thead>
                <tbody>
                    @{
                        if (!ViewBag.IsOilBoxIntied)
                        {
                        <tr>
                            <td colspan="7">该车辆邮箱未初始化，无法分析加油数据</td>
                        </tr>
                        }
                        else
                        {
                            int j = 1;
                            foreach (AddOil item in @ViewBag.AddOil as List<AddOil>)
                            {
                        <tr>
                            <td>@j</td>
                            <td>@item.StartTime</td>
                            <td>@item.EndTime</td>
                            <td>@item.StartOil</td>
                            <td>@item.EndOil</td>
                            <td>@item.AddedOil</td>
                            <td>@item.Location</td>
                        </tr>
                                j++;
                            }
                        }
                    }
                </tbody>
            </table>
        </div>
        <div style="margin-top: 5px;">
            <div style="float: right; margin-right: 18px;">
                <input type="button" value="导出结果" onclick="tableToExcel('加油明细', 'addoil');" />
            </div>
        </div>
    </div>
    <div class="fillparentheight box verticalbox" title="漏油" data-options="closable:false">
        <div class="fillparentheight" style="overflow: auto;">
            <table class="tablelist" id="leakoil">
                <thead>
                    <tr>
                        <th>序号</th>
                        <th>开始时间</th>
                        <th>结束时间</th>
                        <th>漏油前(L)</th>
                        <th>漏油后(L)</th>
                        <th>漏油(L)</th>
                        <th>位置</th>
                    </tr>
                </thead>
                <tbody>
                    @{
                        if (!ViewBag.IsOilBoxIntied)
                        {
                        <tr>
                            <td colspan="7">该车辆邮箱未初始化，无法分析漏油数据</td>
                        </tr>
                        }
                        else
                        {
                            int k = 1;
                            foreach (AddOil item in @ViewBag.LeakOil as List<AddOil>)
                            {
                        <tr>
                            <td>@k</td>
                            <td>@item.StartTime</td>
                            <td>@item.EndTime</td>
                            <td>@item.StartOil</td>
                            <td>@item.EndOil</td>
                            <td>@item.AddedOil</td>
                            <td>@item.Location</td>
                        </tr>
                                k++;
                            }
                        }
                    }
                </tbody>
            </table>
        </div>
        <div style="margin-top: 5px;">
            <div style="float: right; margin-right: 18px;">
                <input type="button" value="导出结果" onclick="tableToExcel('漏油明细', 'leakoil');" />
            </div>
        </div>
    </div>
</div>
@*<script type="text/javascript">
    loadcomplete();
</script>*@
